import java.util.HashSet;
import java.util.Scanner;

public class NGuessNumber {
    public HashSet<Integer> generateAnswer(){
        HashSet<Integer> guess = new HashSet<Integer>();

        while (guess.size() < 4){
            int num = (int)(Math.random()*10);
            guess.add(num);
        }
        System.out.println(guess);
        return guess;
    }
    public int[] getPlayerInput(){
        int[] number = new int[4];
        Scanner input = new Scanner(System.in);
        for (int i = 0; i < number.length; i++) {
            number[i] = input.nextInt();
        }
        return number;
    }
    public boolean compareGuessAnswer(){
        NGuessNumber number = new NGuessNumber();
        HashSet<Integer> integers = number.generateAnswer();
        int[] playerInput = number.getPlayerInput();
        for (int n: integers) {
            for (int a:playerInput) {
                if (n==a){
                    return true;
                }
                return false;
            }
        }
        return false;
    }
}
